package com.iplant.wms.service.po.brm;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@DBBasePO(TableName = "bcm_rule_code", Schemas = DBSchemas.WMS, Name = false,
        CheckName = {"RuleID,Code"}, CodeAuto = true, CodePrefix = "BCN-{yyMM}")
public class BRMSerialNoCode extends BasePO {


    /**
     * 规则字符串  暂时仅支持前缀固定 生成后续
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField
    public String RuleString = "";
    @DBCondition
    @DBField(CheckValue = true)
    public int RuleID = 0;

    /**
     * 包装模板代码
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "RuleCodeEQ")
    @DBJoin(name = "Code", tableName = "brm_serialnorule", Schemas = DBSchemas.WMS, tableAsName = "r1", MainTableField = "RuleID")
    public String RuleCode = "";

    /**
     * 主单位 内包装 箱 栈板
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "brm_serialnorule", Schemas = DBSchemas.WMS, tableAsName = "r1", MainTableField = "RuleID")
    public String RuleName = "";


    public BRMSerialNoCode() {
        super();
    }


    @JsonProperty("RuleString")
    public String getRuleString() {
        return RuleString;
    }

    public void setRuleString(String ruleString) {
        RuleString = ruleString;
    }

    @JsonProperty("RuleID")
    public int getRuleID() {
        return RuleID;
    }

    public void setRuleID(int ruleID) {
        RuleID = ruleID;
    }

    @JsonProperty("RuleCode")
    public String getRuleCode() {
        return RuleCode;
    }

    public void setRuleCode(String ruleCode) {
        RuleCode = ruleCode;
    }

    @JsonProperty("RuleName")
    public String getRuleName() {
        return RuleName;
    }

    public void setRuleName(String ruleName) {
        RuleName = ruleName;
    }
}
